
<?php
class signClass{
	function __construct(){
//			@$url = ($_GET['func'])=='' ? 'signClass' : $GET['func'];
			@$bb=$_GET['func'];
	
				$this->sign();
	
	}
    
	function sign(){
		include("./conf/config.php");
	$username=$_POST["username"];
	$password=$_POST["password"];
	if($username==""){
		echo "<script>alert('请输入用户名！');history.back()</script>";
	}
	if($password==""){
		echo "<script>alert('请输入密码！');</script>";
	}
	
	
	$res=mysql_query("select * from test_acity where username='$username' and password='$password'");
	$count=mysql_fetch_array($res);
	if($username!="" && $password!=""){
		if(!$count){
			echo "<script>alert('用户名或密码错误！');history.back()</script>";
		}else{
			
			session_start();
			$_SESSION['username']=$username;
			$_SESSION['startime']=time();
			if(isset($_SESSION['username'])){
			echo "<script>alert('登录成功');window.location.href='boke/../admin/index_2.php'</script>";	
			}else{
			echo "<script>alert('非法登录');window.location.href='../'</script>";	
			}
			
		}
	}
		
	}
	
		
	
}
			
			
			